package com.pbd.shared;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

import com.google.gwt.user.client.rpc.IsSerializable;

@Entity
@Table(name = "mediarelation")
public class MEDIARELATION implements IsSerializable,Serializable{

	public MEDIARELATION() {

	}

	@Id
	@GenericGenerator(name = "generator", strategy = "increment")
    @GeneratedValue(generator = "generator")
	@Column(name = "id")
	private Long id;

	@Column(name = "mediaType", nullable = false, length = 20)
	private String mediaType;

	@Column(name = "mediaSource", nullable = false, length = 100)
	private String mediaSource;
	
	@Column(name = "secMediaSource", nullable = false, length = 100)
	private String secMediaSource;
	
	
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "albumId", insertable = false, updatable = false)
	private ALBUMMASTER album;


	@Column(name = "isDefault")
	private Boolean isDefault;
	
	@Column(name = "mediaDesc", nullable = false, length = 500)
	private String mediaDesc;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getMediaType() {
		return mediaType;
	}

	public void setMediaType(String mediaType) {
		this.mediaType = mediaType;
	}

	public String getMediaSource() {
		return mediaSource;
	}

	public void setMediaSource(String mediaSource) {
		this.mediaSource = mediaSource;
	}

	public ALBUMMASTER getAlbum() {
		return album;
	}

	public void setAlbum(ALBUMMASTER album) {
		this.album = album;
	}

	
	public String getMediaDesc() {
		return mediaDesc;
	}

	public void setMediaDesc(String mediaDesc) {
		this.mediaDesc = mediaDesc;
	}

	public String getSecMediaSource() {
		return secMediaSource;
	}

	public void setSecMediaSource(String secMediaSource) {
		this.secMediaSource = secMediaSource;
	}

	
	public Boolean getIsDefault() {
		return isDefault;
	}

	public void setIsDefault(Boolean isDefault) {
		this.isDefault = isDefault;
	}
	
	

}
